//引入路由出口
import { Routes, Route, Navigate } from "react-router-dom";

//引入路由懒加载
import { lazy, Suspense } from "react";


//引入页面组件
//登录页面
const Login = lazy(() => import('./pages/login'));
//首页
const Index = lazy(() => import("./pages/index"));



function App() {
  return (
    <Suspense>
      <Routes>
        {/* //跳转到相对应的页面 */}
        <Route path="/index/*" element={<Index></Index>}></Route>
        <Route path="/login" element={<Login></Login>}></Route>

        {/* 重定向 */}
        <Route path="*" element={<Navigate to="/index/home"></Navigate>}></Route>
      </Routes>
    </Suspense>
  );
}

export default App;
